/*
 * @Description  : 
 * @Author       : zhao
 * @Date         : 2022-07-07 14:14:33
 * @LastEditors  : zhao
 * @LastEditTime : 2023-01-11 14:05:12
 */
/*
 * @Description: 校验规则
 * @Author: zhao
 * @Date: 2022-07-07 14:14:33
 * @LastEditors: zhao
 * @LastEditTime: 2022-07-07 17:19:32
 */

const rules = {
    userName: [
        { required: true, message: "请输入账号名称", trigger: "blur" },
        {
            pattern: /^[a-zA-Z]{1}[a-zA-Z0-9_]{5,14}$/,
            message: "6-15个字符,可使用字母、数字、下划线。需以字母开头(账号区分大小写)",
            trigger: "blur",
        },
    ],
    password: [
        { required: true, message: "请输入密码", trigger: "blur" },
        {
            pattern: /^.{8,28}$/,
            message: "密码长度为8之28个字符",
            trigger: "blur",
        },
    ],

    phone: [
        { required: true, message: "请输入手机号", trigger: "blur" },
        {
            pattern: /^(1[3-9])\d{9}$/,
            message: "手机号不正确",
            trigger: "blur",
        },
    ],
    realName: [{ required: true, message: "请输入真实姓名", trigger: "blur" }],
    workCompany: [{ required: true, message: "请输入工作单位", trigger: "blur" }],
    // mail: [
    //     { required: true, message: "请输入邮箱", trigger: "blur" },
    //     {
    //         pattern: /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/,
    //         message: "请输入正确邮箱",
    //         trigger: "blur",
    //     },
    // ],

    idNumber: [
        { required: true, message: "请输入身份证", trigger: "blur" },
        { min: 18, max: 18, message: '身份证长度应为18位', trigger: 'blur' }
    ],
    unitProperties: [{ required: true, message: "请输入单位性质", trigger: "blur" }],
    profession: [{ required: true, message: "请输入所属行业", trigger: "blur" }],
    companyAddress: [{ required: true, message: "请输入单位地址", trigger: "blur" }],
    detailedAddress: [{ required: true, message: "请输入详情地址", trigger: "blur" }],
    code: [{ required: true, message: "请输入验证码", trigger: "blur" }]
}


// rules.userName = [
//     { required: true, message: "请输入账号名称", trigger: "blur" },
//     {
//         pattern: /^[a-zA-Z]{1}[a-zA-Z0-9_]{5,14}$/,
//         message: "6-15个字符,可使用字母、数字、下划线。需以字母开头(账号不区分大小写)",
//         trigger: "blur",
//     },
// ]
// rules.password = [
//     { required: true, message: "请输入密码", trigger: "blur" },
//     {
//         pattern: /(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,64}$/,
//         message: "密码必须包含数字、字母、特殊符号(~!@#$%^&*)且长度为8之28个字符",
//         trigger: "blur",
//     },
// ]
// rules.checkPassword = [{ validator: checkPassword, trigger: "blur" }]
// rules.phone = [
//     { required: true, message: "请输入手机号", trigger: "blur" },
//     {
//         pattern: /^(1[3-9])\d{9}$/,
//         message: "手机号不正确",
//         trigger: "blur",
//     },
// ]
// rules.realName = [{ required: true, message: "请输入真实姓名", trigger: "blur" }]
// rules.workCompany = [{ required: true, message: "请输入工作单位", trigger: "blur" }]
// rules.mail = [
//     { required: true, message: "请输入邮箱", trigger: "blur" },
//     {
//         pattern: /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/,
//         message: "请输入正确邮箱",
//         trigger: "blur",
//     },
// ]



export default rules